ARG JAVA_V=8.472-d131slim
FROM registry.cn-hangzhou.aliyuncs.com/xiaoyilin/temurin-jdk:${JAVA_V}
ARG GROOVY_V=4.0.29
COPY groovy-${GROOVY_V} /usr/local/groovy${GROOVY_V}
ENV GROOVY_HOME=/usr/local/groovy${GROOVY_V}
ENV PATH=$GROOVY_HOME/bin:$PATH
WORKDIR /usr/local/
CMD ["groovy","-version"]


# unzip apache-groovy-binary-4.0.29.zip
# JDK8
# docker build --build-arg JAVA_V=8.472-d131slim --build-arg GROOVY_V=4.0.29 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:4.0.29-8.472 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:4.0.29-8.472
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:4.0.29-8.472
# JDK11
# docker build --build-arg JAVA_V=11.0.29-d131slim --build-arg GROOVY_V=4.0.29 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:4.0.29-11.0.29 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:4.0.29-11.0.29
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:4.0.29-11.0.29
# JDK11+JDK17+JDK21
# docker build --build-arg JAVA_V=11.0.29-d131slim --build-arg GROOVY_V=5.0.2 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:5.0.2-11.0.29 .
# docker build --build-arg JAVA_V=17.0.17-d131slim --build-arg GROOVY_V=5.0.2 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:5.0.2-17.0.17 .
# docker build --build-arg JAVA_V=21.0.9-d131slim --build-arg GROOVY_V=5.0.2 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:5.0.2-21.0.9 .
# docker build --build-arg JAVA_V=25.0.1-d131slim --build-arg GROOVY_V=5.0.2 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:5.0.2-25.0.1 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:5.0.2-11.0.29
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/groovy:5.0.2-11.0.29

# Groovy 4.0 requires Java 8+ with support for up to Java 16.
# https://groovy.apache.org/download.html#requirements
# https://archive.apache.org/dist/groovy/
#binary：二进制包
#source：源文件
#documentation：文档
#SDK bundle：SDK包，包含前面三种类型